using System;
using System.Collections.Generic;
using System.Text;
using BusinessObjects.BO_Actions;
using Entity.StoreProcedure;
using BusinessObjects;
using System.Data;
namespace BusinessObjects.BO_GetObjects {
    public static class BO_portal_contact_us {
        public static DataTable SelectAll(int status) {
            try {
                usp_portal_contact_us_select_all entity = new usp_portal_contact_us_select_all();
                entity.STATUS = status;
                return BO_Actions<usp_portal_contact_us_select_all>.ExecuteAndReturnDataTable(entity);
            } catch (Exception ex) {
                throw ex;
            }
        }
        public static DataTable SelectTop(int rows, int status) {
            try {
                usp_portal_contact_us_select_top entity = new usp_portal_contact_us_select_top();
                entity.NUMBERRECORD = rows;
                entity.STATUS = status;
                return BO_Actions<usp_portal_contact_us_select_top>.ExecuteAndReturnDataTable(entity);
            } catch (Exception ex) {
                throw ex;
            }
        }
        public static DataTable Search(int contact_id) {
            try {
                usp_portal_contact_us_search entity = new usp_portal_contact_us_search();
                entity.CONTACT_ID = contact_id;

                return BO_Actions<usp_portal_contact_us_search>.ExecuteAndReturnDataTable(entity);
            } catch (Exception ex) {
                throw ex;
            }
        }
        public static DataTable SelectWithPaged(int startIndex, int pageCount, int status) {
            try {
                usp_portal_contact_us_select_paged entity = new usp_portal_contact_us_select_paged();
                entity.STARTINDEX = startIndex;
                entity.MAXRECORDS = pageCount;
                entity.STATUS = status;
                return BO_Actions<usp_portal_contact_us_select_paged>.ExecuteAndReturnDataTable(entity);
            } catch (Exception ex) {
                throw ex;
            }
        }
        public static string Insert(string sender_name, string sender_email, string contact_title, string mobile, string company, string address, string attach_file, string contact_detail, bool is_read, DateTime created_date, bool status) {
            try {
                usp_portal_contact_us_insert entity = new usp_portal_contact_us_insert();
                entity.SENDER_NAME = sender_name;
                entity.SENDER_EMAIL = sender_email;
                entity.CONTACT_TITLE = contact_title;
                entity.MOBILE = mobile;
                entity.COMPANY = company;
                entity.ADDRESS = address;
                entity.ATTACH_FILE = attach_file;
                entity.CONTACT_DETAIL = contact_detail;
                entity.IS_READ = is_read;
                entity.CREATED_DATE = created_date;
                entity.STATUS = status;

                return BO_Actions<usp_portal_contact_us_insert>.ExecuteAndReturnStringValue(entity);
            } catch (Exception ex) {
                throw ex;
            }
        }
        public static string Update(Int64 contact_id, string sender_name, string sender_email, string contact_title, string mobile, string company, string address, string attach_file, string contact_detail, bool is_read, DateTime created_date, bool status) {
            try {
                usp_portal_contact_us_update entity = new usp_portal_contact_us_update();
                entity.CONTACT_ID = contact_id;
                entity.SENDER_NAME = sender_name;
                entity.SENDER_EMAIL = sender_email;
                entity.CONTACT_TITLE = contact_title;
                entity.MOBILE = mobile;
                entity.COMPANY = company;
                entity.ADDRESS = address;
                entity.ATTACH_FILE = attach_file;
                entity.CONTACT_DETAIL = contact_detail;
                entity.IS_READ = is_read;
                entity.CREATED_DATE = created_date;
                entity.STATUS = status;

                return BO_Actions<usp_portal_contact_us_update>.ExecuteAndReturnStringValue(entity);
            } catch (Exception ex) {
                throw ex;
            }
        }
        public static bool Delete(string ids, string spliter, int delete_type) {
            try {
                usp_portal_contact_us_delete entity = new usp_portal_contact_us_delete();
                entity.IDS = ids;
                entity.SPLITER = spliter;
                entity.DELETE_TYPE = delete_type;

                return BO_Actions<usp_portal_contact_us_delete>.ExecuteAndReturnBooleanValue(entity);
            } catch (Exception ex) {
                throw ex;
            }
        }
        public static bool Restore(int contact_id) {
            try {
                usp_portal_contact_us_restore entity = new usp_portal_contact_us_restore();
                entity.CONTACT_ID = contact_id;

                return BO_Actions<usp_portal_contact_us_restore>.ExecuteAndReturnBooleanValue(entity);
            } catch (Exception ex) {
                throw ex;
            }
        }
        public static DataTable SelectAdmin(string keywords, int startIndex, int pageCount, int status) {
            try {
                usp_portal_contact_us_select_admin entity = new usp_portal_contact_us_select_admin();
                entity.STARTINDEX = startIndex;
                entity.MAXRECORDS = pageCount;
                entity.STATUS = status;
                entity.KEYWORDS = keywords;
                return BO_Actions<usp_portal_contact_us_select_admin>.ExecuteAndReturnDataTable(entity);
            } catch (Exception ex) {
                throw ex;
            }
        }
        public static bool Read(int contact_id, bool isread) {
            try {
                usp_portal_contact_us_read entity = new usp_portal_contact_us_read();
                entity.CONTACT_ID = contact_id;
                entity.IS_READ = isread;
                return BO_Actions<usp_portal_contact_us_read>.ExecuteAndReturnBooleanValue(entity);
            } catch (Exception ex) {
                throw ex;
            }
        }
    }
}

